This page last changed on Jun 26, 2008 by salamy.

Command Line Access Setup

The MBARI CVS Repository may be accessed on Linux systems with Command Line control should you decide to not use a GUI.


Setup of .bashrc file


To set up the CVSROOT on your Linux system, first log into your user /home account and add the following line to your account's .bashrc file.


export CVSROOT=:pserver:your_userName@moonjelly.shore.mbari.org:/home/cvs


This will allow you to access the CVS Repository without having to set up the CVSROOT each time (i.e., your CVSROOT will be renewed each time you log in to your computer).

NOTE!! Remember to re-source your .bashrc file the first time you set this up so that the edit takes effect.


[userName@computerName]$ source ~/.bashrc



Logging in to CVS


After logging into your account, you will need to log in to the CVS Repository.  You should only have to do this once in the window you are using during each session.


[userName@computerName]$ cvs login


You should get the following response from the computer:

Logging in to :pserver:your_userName@moonjelly.shore.mbari.org:2401/home/cvs
CVS password:

Enter your CVS password at the prompt.  If you have entered the correct password you will be returned to a  [userName@computerName]$  prompt.  You are now logged in and can access project modules on the system.  If you receive a login error from the system, re-check your password as forgotten passwords is the number one problem experienced by CVS users.  If the problem persists, please contact Karen Salamy (the CVS Repository Administrator):  salamy@mbari.org   .



CVS Command Line Usage



CVS has an enormous number of commands and options available. Usage of Command Lines for CVS requires familiarization with the command calls.  A common link is provided below to help get started:

CVS Command Line Reference Guide




Additional Usage Guidance

(from http://badgertronics.com/writings/cvs/command-line.html_)_


The general format of CVS commands is:

% cvsgeneral-optionscommand-namecommand-specific-optionsfilename

Here's how to get help:

cvs --help-commands Show all of the commands
cvs --help-options Shows the "global" options, which apply to all commands. The most useful of these is -n, which doesn't execute anything that will change files stored on the disk, but shows what work it would have done.
cvs -H command Show the command-specific options.

Task Reference

Action How to do it.
Sync your tree with the repository.
See what files are modified or haven't been checked in
cvs update(sample)
See complete revision history for a file cvs log filename(sample)
See revision comment for one revision cvs log -r1.5 filename
See the differences between a file and its last checked in version cvs diff filename
See the differneces between two checked-in revisions of a file cvs diff -r1.4 -r1.7 filename(sample)
See who modified each line of a file, with what revision cvs annotate filename(sample) This is handy when you see a line of really bogus code and you want to know who was reponsible.
Add a new file to the repository Create the file
cvs add filename
cvs commit -m "Initial Revision" filename
Add a new binary file to the repository Create the file
cvs add -kb filename
cvs commit -m "Initial Revision" filename A "binary file" won't have CVS keyword expansion performed on it.
Add a new directory to the project cd to the directory's parent cvs add directoryname
Checking a file's changes into the repository. cvs commit -m "check-in comment" filenameIf your check-in comment is more than one line, leave off the the -m option and use the editor that is brought up.
Revert a file to its last checked-in revision Remove the file
cvs update filename
Add a whole directory tree as a new project cdto the project directory
cvs import -m "project name" directory "ArsDigita" "initial-development" Note that this does not change directory into a CVS-controlled tree. You'll need to remove the tree and check it out.
Check out a whole project cvs checkout project-name
Label a tree for concurrent development cd to the parent directory of your tree
cvs tag -R -b labelname This will use the currently-checked-out versions of the files as they exist in your directory tree.
The -b argument means that this tag is a "branch" tag, meaning that someone can check out a new tree based on this tag and do development.
If you omit the -b, the label will be a "sticky" tag, meaning that someone won't be able to check in new changes under that label. See the notes on Labeling and Branching
Check out a tree based on a label cvs checkout -r labelname projectnameIf labelname was created as a "branch" tag, then you can check in changes without affecting anyone using the development tip. Otherwise files are considered "sticky" and changes cannot be checked in.
Change a file to be treated as a binary file after it's been added cvs admin -kb filename A "binary file" won't have CVS keyword expansion performed on it.



Document generated by Confluence on Feb 04, 2026 09:02